#define _CRT_SECURE_NO_WARNINGS 1
class Solution {
public:
    vector<int> printListReversingly(ListNode* head) {
        vector<int>s;
        for (auto p = head; p; p = p->next) s.push_back(p->val);
        reverse(s.begin(), s.end());
        return s;
    }
};